package xiangya.bysj.mapper.interf;

import java.util.List;

import xiangya.bysj.entity.Patient;
import xiangya.bysj.entity.User;



public interface PatientMapper extends MapperInterface<Patient> {
	/**
	 * 
	 * @param userid 用户id
	 * @return 这个用户下的所有服药者的list
	 * @throws Exception
	 */
	public List<Patient> findPatientsByUser(int userid) throws Exception;
	
	/**
	 * 
	 * @param id 服药者的id
	 * @return 服药者的实体类 
	 * @throws Exception
	 */
	public Patient findPatientById(int id) throws Exception;
	
	/**
	 * 
	 * @param patients 要添加的服药者的list
	 * @throws Exception 
	 */
	public void savePatients(List<Patient> patients) throws Exception;
	
	/**
	 * 
	 * @param patientsID 要批量删除的服药者的id的list 
	 * @throws Exception
	 */
	public void deletePatients(List<Integer> patientsID) throws Exception; 
	

	public List<Patient> findPatientByName(String name) throws Exception;
	
	
	public User selectUserByPatient(int patient) throws Exception;
	
}
